<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta name = "format-detection" content = "telephone=no">
    <title><?php echo getStoreName($_GET['local_id']);?>-<?php echo ($pdetail["name"]); ?></title>
    <link rel="stylesheet" href="/Public/Home/css/swiper.min.css">
    <link rel="stylesheet" href="/Public/Home/css/goodsDetail.css">
    <script type="text/javascript">
		var yc_share_diy = true;
	</script>
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
</head>
<body>
<script>
    var isExistDjsTime = false;
</script>
<div class="swiper-container">
    <div class="swiper-wrapper">
        <?php if(empty($phones)): ?><div class="swiper-slide"><img src="/Public/Home/images/banner_01.jpg"></div>
            <div class="swiper-slide"><img src="/Public/Home/images/banner_01.jpg"></div>
            <?php else: ?>
            <?php if(is_array($phones)): $i = 0; $__LIST__ = $phones;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><div class="swiper-slide">
                    <?php if($item['l_url'] != ''): ?><img src="<?php echo ($item['l_url']); ?>">
                     <?php else: ?>
                        <img src="/Public/Home/images/blank.png"><?php endif; ?>
                </div><?php endforeach; endif; else: echo "" ;endif; endif; ?>

    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
    <!-- todo 倒计时 -->
    <?php if(!empty($flashGoods)): ?><div class="count-down">
            距离结束还有：<span class="hour_show">0</span>:<span class="minute_show">0</span>:<span class="second_show">0</span>
        </div>
        <script>
            isExistDjsTime = true;
            var djs_startTimes = [<?php echo isset($flashGoods['begin_time']) ? ("'".date('Y-m-d H:i:s',$flashGoods['begin_time'])."'"): ''; ?>];
            var djs_endTimes = [<?php echo isset($flashGoods['end_time']) ? ("'".date('Y-m-d H:i:s',$flashGoods['end_time'])."'"): ''; ?>];
        </script><?php endif; ?>
    <!-- 收藏功能 -->
    <div class="goods-collect <?php if($productLike[like_id]): ?>active<?php endif; ?>" data-product-id="<?php echo ($pdetail["product_id"]); ?>" data-local-id="<?php echo ($pdetail["local_id"]); ?>"></div>
</div>
<!-- 商品基本信息 -->
<!--
<div class="goods-basic">
    <h1><?php echo ($pdetail["name"]); ?></h1>
    <h4><?php echo ($pdetail["brief"]); ?></h4>
    <div class="bot-box">

        <div class="buy-info">
            <p class="num clearfix">
                <a href="javascript:;" class="minus off">-</a><span class="txt"><?php echo ($default_num); ?></span><a href="javascript:;" class="plus on">+</a>
            </p>
            <p class="data">
                &lt;!&ndash;todo 购买数量&ndash;&gt;
                已销售<?php echo ($pdetail["sales_num"]); ?>件
            </p>
        </div>
    </div>
    <p class="clearfix"></p>
</div>
-->




<div class="goods-basic">
    <h1><?php echo ($pdetail["name"]); ?></h1>
    <h4><?php echo ($pdetail["spec_info"]); ?></h4>
    <div class="bot-box">
        <div class="price-info">


            <?php if(empty($flashGoods)): if(empty($proPrice)): ?><p class="prs"><span class="now-price"><?php echo (number_format($pdetail["price"], 2, '.', '')); ?></span>
                        <!--<span class="old-price"><?php echo (number_format($pdetail["marketprice"], 2, '.', '')); ?></span>-->
                    </p>
                 <?php else: ?>
                    <p class="prs">
                        <span class="now-price"><?php echo (number_format($proPrice["price"], 2, '.', '')); ?></span>
                        <?php if($proPrice["price"] != $pdetail.price): ?><span class="old-price"><?php echo (number_format($pdetail["price"], 2, '.', '')); ?></span><?php endif; ?>
                    </p><?php endif; ?>
            <?php else: ?>
                <p class="prs"><span class="now-price"><?php echo (number_format($flashGoods["promotion_price"], 2, '.', '')); ?></span></p><?php endif; ?>





            <p class="sps">
                <?php if(!empty($flashGoods)): ?><label>闪</label><?php endif; ?>
                <?php if((!empty($proPrice)) and ($proPrice["price"] != $pdetail.price)): ?><label>促销</label><?php endif; ?>
                <?php if(is_array($tags)): $i = 0; $__LIST__ = $tags;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tag): $mod = ($i % 2 );++$i;?><label><?php echo ($tag); ?></label><?php endforeach; endif; else: echo "" ;endif; ?>
            </p>

        </div>
        <div class="buy-mes">
            <p class="data">
                <!--已有6000人购买-->  已销售<?php echo ($pdetail["sales_num"]); ?>件
            </p>
        </div>

        <!--<div class="buy-info">
            <p class="num clearfix">
                <a href="javascript:;" class="minus off">-</a><span class="txt"><?php echo ($default_num); ?></span><a href="javascript:;" class="plus on">+</a>
            </p>
            <p class="data">
                &lt;!&ndash;todo 购买数量&ndash;&gt;
                已销售<?php echo ($pdetail["sales_num"]); ?>件
            </p>
        </div>-->



    </div>
    <p class="clearfix"></p>
</div>



<!-- 商品促销信息 -->
<div class="goods-promotion-info">
    <!--<h4>促销</h4>
    <div class="promotion-label">
        <p><label>立减20.9</label>搭配“札幌農学校特制牛奶饼干12枚...</p>
        <p><label>平安专享</label>搭配“札幌農学校特制牛奶饼干12枚...</p>
        <p><label>15天退货</label>搭配“札幌農学校特制幌農学校特制牛奶饼干12枚...</p>
    </div>-->
    <!--提示说明 -->
    <?php if($pdetail['explain']): ?><p class="goods-notice">特别说明：<?php echo ($pdetail['explain']); ?></p><?php endif; ?>
</div>
<!-- 商品服务 -->
<?php if(count($storeData['services']) > 0): ?><div class="goods-service">
        <?php if(is_array($storeData['services'])): $i = 0; $__LIST__ = $storeData['services'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><span><?php echo ($vo); ?></span><?php endforeach; endif; else: echo "" ;endif; ?>
    </div><?php endif; ?>
<!-- 店铺名称和联系 -->
<div class="goods-contact mgTop">
    <div class="name"><i></i><a style="color:#232726;" href="<?php echo url('store/index');?>"><?php echo ($storeData["local_name"]); ?></a></div>
    <div class="contact"><i></i><a href="tel://<?php echo ($storeData["tel"]); ?>">联系商家</a></div>
</div>
<!-- 商品亮点 -->
<!--<div class="goods-merits mgTop">
    <div class="title_01"><span>商品亮点</span></div>
    <div class="merits-content">
        <?php if(is_array($pdetail["highlight"])): foreach($pdetail["highlight"] as $key=>$vo): if($vo != ''): ?><p><?php echo ($vo); ?></p><?php endif; endforeach; endif; ?>
    </div>
</div>-->

<!-- 优惠套餐 -->

<?php if($group_len != 0): ?><div class="discount mgTop">
        <div class="title_01"><span>优惠套餐</span></div>
        <a href="<?php echo url('goods/groupGoods',array('id'=>$pdetail['store_pid']));?>" class="more">共<?php echo ($group_len); ?>个套餐</a>
        <a href="<?php echo url('goods/groupGoods',array('id'=>$pdetail['store_pid']));?>" class="list">
            <?php $k = 0;?>
            <?php if(is_array($group_product['list'])): $i = 0; $__LIST__ = array_slice($group_product['list'],0,3,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$product): $mod = ($i % 2 );++$i; if($k > 0){?><label>+</label><?php }?>
                <span>
                    <img class="img-lazyload" src="/Public/Home/images/blank.png" data-original="<?php echo (getthumb($product['goods_id'])); ?>">
                    <i>￥<?php echo ($product['price']); ?></i>
                </span>
                <?php $k++; endforeach; endif; else: echo "" ;endif; ?>
        </a>
        <p class="discount-total">
            <span>立省¥<?php echo ($group_product['sheng']); ?></span><label>¥<?php echo (number_format($group_product['total_price'], 2, '.', '')); ?></label>
        </p>
    </div><?php endif; ?>

<!-- 商品选项卡信息 -->
<div class="goods-tab-details mgTop" style="padding-bottom:1.1rem;">
    <ul class="goods-tab-title">
        <li class="active">商品详情</li>
        <li>评价</li>
        <li>温馨提示</li>
    </ul>
    <div class="goods-tab-content" style="display:block;">
        <!-- 商品规格 -->
        <div class="goods-norms">
            <div class="norms-table">
                <table cellspacing="1" cellpadding="0" width="100%">
                    <?php if(is_array($pdetail['goods_property'])): $key = 0; $__LIST__ = $pdetail['goods_property'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($key % 2 );++$key; if($key !=1): ?><tr>
                                <td><strong><?php echo ($key); ?></strong></td>
                                <td><?php echo ($item); ?></td>
                            </tr><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                </table>
            </div>
        </div>
        <!-- 商品详情 -->
        <div class="goods-detail mgTop">
            <div id="detail-content-ajax" class="detail-content slideContent">
                正在加载内容...
            </div>
        </div>
    </div>
    <div class="goods-tab-content">
        <!-- 商品评价 -->
        <div class="goods-comment">
            <p class="total-score">
                <span>综合评分<label><?php echo ((isset($comments["info"]["grade"]) && ($comments["info"]["grade"] !== ""))?($comments["info"]["grade"]):5); ?></label></span>
                <span>好评率<label><?php echo (floattopercent($comments["info"]["good_comment"])); ?></label></span>
                <span><?php echo ((isset($comments["totalnum"]) && ($comments["totalnum"] !== ""))?($comments["totalnum"]):0); ?>条评价</span>
            </p>
            <?php if(count($comments['list']) > 0): if(is_array($comments['list'])): $i = 0; $__LIST__ = $comments['list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><div class="goods-comment-item">
                        <h4><span><img src="<?php echo ((isset($item["logo"]) && ($item["logo"] !== ""))?($item["logo"]):'/Public/Home/images/userPic.png'); ?>" alt=""><label><?php echo ((isset($item["nickname"]) && ($item["nickname"] !== ""))?($item["nickname"]):'无名'); ?></label></span><span><?php echo ($item["create_time"]); ?></span></h4>
                        <p><?php echo ($item["content"]); ?></p>
                    </div><?php endforeach; endif; else: echo "" ;endif; ?>
                <?php else: ?>
                <div class="goods-comment-item">
                    <p>暂无评论</p>
                </div><?php endif; ?>
            <?php if($comments['totalnum'] > 12): ?><div class="comment-more"><a href="<?php echo url('home/goods/getMoreComment',['id'=>$id]);?>">查看更多></a></div><?php endif; ?>
        </div>
    </div>
    <div class="goods-tab-content">
        <!-- 温馨提示 -->
        <div class="remind">
            <div class="remind-content">
                <!--<p>使用时间：2016.7.13-2016.8.1；</p>
                <p>营业时间：11:00-24:00；</p>
                <p>本产品支持随时退款；</p>
                <p>如需开具发票，请具体咨询客服；</p>
                <p>如有疑问，请联系怡臣客服。</p>-->
                <p><?php  echo html_entity_decode($storeData['wenxintishi'], ENT_QUOTES, 'UTF-8');?></p>
                <!--<p class="service-tel"><a href="javascript:void(0);">联系客服</a></p>-->
            </div>
        </div>
    </div>
</div>


<div class="fixed-bot-cart">
    <p class="add-cart">
        <a href="<?php echo url('home/carts/cart');?>">
            <span id="unique-cart-number" class="cart-number"><?php echo ($cnum["num"]); ?></span>
            <label class="add_number">+1</label></a>
    </p>
    <?php if(!empty($flashGoods)): if($flashGoods['initnum'] == 0): ?><div class="buy-info">
            <p class="sold-out-state"><a class="btn btn-primary btn-block">商品售罄</a></p>
            </div>
            <?php else: ?>
                <div class="buy-info">
                    <div class="ajax_goodsId" style="display: none" data-carturl="<?php echo u('home/carts/addcart');?>" data-glist="<?php echo ($plist['spec_num']); ?>" data-glist_total="<?php echo ($plist['spec_num_total']); ?>" data-sid="<?php echo ($pdetail["local_id"]); ?>"  data-pid="<?php echo ($pdetail["product_id"]); ?>"  data-url="<?php echo u('home/carts/isStore');?>" data-gid="<?php echo ($pdetail["goods_id"]); ?>" data-spid="<?php echo ($pdetail["store_pid"]); ?>"></div>

                    <?php if($plist['spec_num'] == 1 And $plist['spec_num_total'] > 1): ?><p class="sold-out-state"><a class="btn btn-default btn-block add-goods">加入购物车</a></p>
                        <?php else: ?>
                        <p class="num clearfix">
                            <a href="javascript:;" class="minus off">-</a><span class="txt" id="number"><?php echo ($default_num); ?></span><a href="javascript:;" class="plus on add-goods" data-pid="<?php echo ($pdetail["product_id"]); ?>">+</a>
                        </p><?php endif; ?>
                    
                </div><?php endif; ?>

        <?php else: ?>

        <?php if($plist[0]['enStore'] == 0): ?><div class="buy-info">
            <p class="sold-out-state"><a class="btn btn-primary btn-block">商品售罄</a></p>
            </div>
            <?php else: ?>
            <div class="buy-info">
                <div class="ajax_goodsId" style="display: none" data-carturl="<?php echo u('home/carts/addcart');?>" data-glist="<?php echo ($plist['spec_num']); ?>" data-glist_total="<?php echo ($plist['spec_num_total']); ?>" data-sid="<?php echo ($pdetail["local_id"]); ?>"  data-pid="<?php echo ($pdetail["product_id"]); ?>"  data-url="<?php echo u('home/carts/isStore');?>" data-gid="<?php echo ($pdetail["goods_id"]); ?>" data-spid="<?php echo ($pdetail["store_pid"]); ?>"></div>

                <?php if($plist['spec_num'] == 1 And $plist['spec_num_total'] > 1): ?><p class="sold-out-state"><a class="btn btn-default btn-block add-goods">加入购物车</a></p>
                    <?php else: ?>
                    <p class="num clearfix">
                        <a href="javascript:;" class="minus off">-</a><span class="txt" id="number"><?php echo ($default_num); ?></span><a href="javascript:;" class="plus on add-goods" data-pid="<?php echo ($pdetail["product_id"]); ?>">+</a>
                    </p><?php endif; ?>

            </div><?php endif; endif; ?>

</div>

<div class="goods-norms-popup">
    <h3><?php if($plist['spec_num'] != 0 And $plist['spec_num_total'] > 1): ?>请选择参数/规格/购买数量<?php endif; ?><a href="javascript:void(0);" class="close spec_info_close">×</a></h3>

    <?php if($plist['spec_num'] == 1 And $plist['spec_num_total'] > 1): ?><ul class="gg-goods-list">
            <?php if(is_array($plist)): $k = 0; $__LIST__ = $plist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($k % 2 );++$k; if($item["spec_info"] != NULL ): ?><li <?php if($item["enStore"] == 0 ): ?>class="out-stock"<?php else: ?>
                    <?php if(($item["product_id"]) == $pdetail["product_id"]): ?>class="active"<?php endif; endif; ?> >
                <span class="tit"><?php echo ($item["spec_info"]); ?>
                <?php if($item["msg"] != NULL ): ?><label class="isProductsg"><?php echo ($item["msg"]); ?></label><?php endif; ?>
                </span>
                    <span class="price">￥<?php echo (number_format($item["price"], 2, '.', '')); ?></span>

                    <?php if(!empty($flashGoods)): if($flashGoods['initnum'] == 0): ?><span class="status">售罄</span>
                            <?php else: ?>
                            <p class="operate">
                                <a href="javascript:;" class="minus off">-</a><span class="txt">0</span><a href="javascript:;" class="plus on" data-pid="<?php echo ($item['product_id']); ?>">+</a>
                            </p><?php endif; ?>


                        <?php else: ?>
                        <?php if($item['enStore'] == 0): ?><span class="status">售罄</span>
                            <?php else: ?>
                            <p class="operate">
<a href="javascript:;" class="minus off">-</a><span class="txt"><?php echo ($item['gDetail_Cart_num']); ?></span><a href="javascript:;" class="plus on" data-pid="<?php echo ($item['product_id']); ?>">+</a>
                            </p><?php endif; endif; ?>


                    </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
        </ul><?php endif; ?>
    <div class="cart-check-area">
        <a>
            <i class="cart"></i>
            <span id="gg-cart-buy-num" class="cart-number num"><?php echo ($cnum["num"]); ?></span>
            <label class="add_number">+1</label>
        </a>
        <a href="<?php echo url('Carts/cart');?>"><i class="cart"></i></a>
        <p class="tip">
            <span class="price" id="only-price">￥<?php echo ($CartMoney); ?></span>
            <span class="sp-info"><?php echo ($storeData['maxPriceDesc']); ?></span>
        </p>
    </div>
</div>
<!-- 提示弹窗 -->
<div class="alert-popup">
    <p>是否允许拨打客服电话<?php echo ($storeData["tel"]); ?></p>
    <p><a href="javascript:void(0);" class="cancel">取消</a><a href="javascript:void(0);" class="confirm">允许</a></p>
</div>
<!-- 优惠卷兑换 -->
<div class="coupon-btn"><span>兑换</span></div>
<!-- 兑换流程 -->
<div class="coupon-redeem-box" style="display: none">
    <span class="close"></span>
    <div class="redeem-state">
        <div class="red-inputInfo">
            <h1>礼券兑换</h1>
            <input type="text" placeholder="请输入你的兑换码" id="cdKey"> 
            <a id="cup_btn" href="javascript:void(0);">兑换</a>               
        </div>
        <p class="red-code-tips clearfix">请输入你的兑换码！</p>
        <div class="cup-success" style="display:none;">  
            <span></span>
            <p>您可在个人中心查看，该窗口<i>3</i>秒后自动关闭</p>              
        </div>
    </div>
</div>

<link rel="stylesheet" href="/Public/Home/css/phoneCheck.css">
<div class="alert-popup bindPhone">
    <p>你还没有绑定手机号，为了你更好的体验怡臣请先绑定手机号。</p>
    <p><a href="javascript:void(0);" class="cancel">先看看</a><a href="javascript:void(0);" class="confirm">绑定手机</a></p>
</div>
<div class="bindPhone-box" style="display:none">
    <span class="close"></span>
    <div class="inputInfo">
        <h1>验证手机号</h1>
        <ul>
            <li><input type="text" placeholder="请输入绑定手机号" id="phone"> <a href="javascript:void(0);" id="yzCaptcha">获取验证码</a></li>
            <li>
                <div class="pincode-input-container touch" id="pincode-list">
                    <div style="display: none;">
                        <input type="password" readonly pattern="[0-9]*" inputmode="numeric" id="preventautofill" autocomplete="off">
                    </div>
                    <div class="touchwrapper touch4">
                        <input type="password" pattern="[0-9]*" readonly inputmode="numeric" maxlength="4" autocomplete="off" class="form-control pincode-input-text">
                        <table class="touchtable">
                            <tbody>
                            <tr>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td class="last"></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="text-danger pincode-input-error"></div>
                </div>
                <input type="text" id="code-input" style="display:none;">
                <p class="code-tips" style="display:none;"></p>
            </li>
        </ul>
    </div>
    <div class="success" style="display:none;">
        <ul>
            <li>
                <span>绑定成功!</span>
                <p>该窗口<i>3</i>秒后自动关闭</p>
            </li>
        </ul>
    </div>
</div>


<!-- 子类主菜单 -->
<div class="subclass-main-nav">
    <div class="subclass-main-on"><a href="javascript:void(0)"><span>快速导航</span></a></div>
</div>
<div class="subclass-main-menu" style="display: none;">
    <div class="subclass-main-off"><a href="javascript:void(0)" class="close"><span>快速导航</span></a></div>
    <div class="subclass-main-menu-demo">
        <a href="<?php echo url('store/index');?>" class="home active"><span></span><p>首页</p></a>
        <a href="<?php echo url('category/index');?>" class="category"><span></span><p>分类</p></a>

        <?php $qgs_id = ($_GET['local_id']=='11') ? $_GET['top_local_id'] : $_GET['local_id']; ?>
        <a href="<?php echo url('store/index', ['local_id' => '11','top_local_id' => $qgs_id]);?>" class="store-way active"><span></span><p>全国送</p></a>
        <a href="<?php echo url('carts/cart');?>" class="cart"><span></span><p>购物车</p></a>
        <a href="<?php echo url('Member/index');?>" class="mine"><span></span><p>我的</p></a>
    </div>         
</div>


<script type="text/javascript">
    var _good_id = "<?php echo $_GET["id"]; ?>";
    require(['goodsDetail','subClassMain']);	
</script>
</body>
</html>